package com.example.zengfansheng.fragmentstatedemo;

import android.os.Bundle;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;

public class MainActivity extends AppCompatActivity {

    private static final String TAG = "hacket";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Log.d(TAG, getClass().getSimpleName() + " , " + "onCreate: savedInstanceState:" + savedInstanceState);
    }

    public void load(View view) {
        FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
        MyFragment myFragment = MyFragment.newInstance("haha , i am hacket~!");
        ft.replace(R.id.fl, myFragment);
        ft.commit();
    }

}